<template>
    <el-header style="width: 100%;background-color: aqua;">
      <p style="text-align: center;padding-top: 1.3%;padding-bottom: 1%;">大二新闻管理系统后台 <button style="float: right;background-color: aqua;border-style: none;" @click="ret">返回主页</button></p>
    </el-header>
    <el-col :span="12">
      <el-menu
      style="width: 30%;float: left;"
        active-text-color="#ffd04b"
        background-color="#545c64"
        class="el-menu-vertical-demo"
        default-active="2"
        text-color="#fff"
        @open="handleOpen"
        @close="handleClose"
      >
        <el-sub-menu index="1">
          <template #title>
            <el-icon><location /></el-icon>
            <span>新闻管理</span>
          </template>
          <router-link to="/background/table" style="text-decoration: none;">
            <el-menu-item index="1-1">全部新闻</el-menu-item>
          </router-link>
        </el-sub-menu>
        <el-sub-menu index="2">
          <template #title>
            <el-icon><icon-menu /></el-icon>
            <span>用户管理</span>
          </template>
          <router-link to="/background/tableuser" style="text-decoration: none;">
            <el-menu-item index="2-1">全部用户</el-menu-item>
          </router-link>
        </el-sub-menu>

        <el-sub-menu index="3">
          <template #title>
            <el-icon><icon-menu /></el-icon>
            <span>评论管理</span>
          </template>
            <router-link to="/background/comments" style="text-decoration: none;">
              <el-menu-item index="3-1">全部评论</el-menu-item>
            </router-link>
        </el-sub-menu>
        
        
      </el-menu>
      
    </el-col>
    <router-view ></router-view>
</template>

<script setup>
import router from "@/router";
import {
  Document,
  Menu as IconMenu,
  Location,
  Setting,
} from '@element-plus/icons-vue'

function ret(){
  router.push('/')
}
function handleOpen(){

}
function handleClose(){

}

</script>
<style >

:deep(.el-menu el-menu--vertical el-menu-vertical-demo){
  height: 100%;
}
</style>